<?php
	require '../ini.php';
	require '../../classes/xl_hoa_don.php';
	require '../../classes/pager.php';
	
	$dt_xl_hoa_don = new xl_hoa_don;
	$dt_pager = new pager;
	
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
 
	<head>
		
		<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
		
		<title>Đơn hàng [Danh sách]</title>
		
		<!--                       CSS                       -->
	  
		<!-- Reset Stylesheet -->
		<link rel="stylesheet" href="../skins/sa/resources/css/reset.css" type="text/css" media="screen" />
	  
		<!-- Main Stylesheet -->
		<link rel="stylesheet" href="../skins/sa/resources/css/style.css" type="text/css" media="screen" />
		
		<!-- Invalid Stylesheet. This makes stuff look pretty. Remove it if you want the CSS completely valid -->
		<link rel="stylesheet" href="../skins/sa/resources/css/invalid.css" type="text/css" media="screen" />	
        
        <!-- Cau hinh lai css -->
        <link rel="stylesheet" href="../css/style.css" type="text/css" media="screen" />
		
		<!-- Colour Schemes
	  
		Default colour scheme is green. Uncomment prefered stylesheet to use it.
		
		<link rel="stylesheet" href="../skins/sa/resources/css/blue.css" type="text/css" media="screen" />
		
		<link rel="stylesheet" href="../skins/sa/resources/css/red.css" type="text/css" media="screen" />  
	 
		-->
		
		<!-- Internet Explorer Fixes Stylesheet -->
		
		<!--[if lte IE 7]>
			<link rel="stylesheet" href="../skins/sa/resources/css/ie.css" type="text/css" media="screen" />
		<![endif]-->
		
		<!--                       Javascripts                       -->
  
		<!-- jQuery -->
		<script type="text/javascript" src="../skins/sa/resources/scripts/jquery-1.3.2.min.js"></script>
		
		<!-- jQuery Configuration -->
		<script type="text/javascript" src="../skins/sa/resources/scripts/simpla.jquery.configuration.js"></script>
		
		<!-- Facebox jQuery Plugin -->
		<script type="text/javascript" src="../skins/sa/resources/scripts/facebox.js"></script>
		
		<!-- jQuery WYSIWYG Plugin -->
		<script type="text/javascript" src="../skins/sa/resources/scripts/jquery.wysiwyg.js"></script>
		
		<!-- Internet Explorer .png-fix -->
		
		<!--[if IE 6]>
			<script type="text/javascript" src="../skins/sa/resources/scripts/DD_belatedPNG_0.0.7a.js"></script>
			<script type="text/javascript">
				DD_belatedPNG.fix('.png_bg, img, li');
			</script>
		<![endif]-->
		
	</head>
  
	<body><div id="body-wrapper"> <!-- Wrapper for the radial gradient background -->
		
		<?php include '../widgets/sidebar.php'; ?> <!-- End #sidebar -->
		
		<div id="main-content"> <!-- Main Content Section with everything -->
			
			<?php include '../widgets/noscript.php'; ?>
			
			<!-- Page Head -->
			
		  <!-- End .shortcut-buttons-set -->
			
			<div class="clear"></div> <!-- End .clear -->
			
			<div class="content-box"><!-- Start Content Box -->
				
				<div class="content-box-header">
					
					<h3>Phiếu đăng ký [Danh sách]</h3>
					
					<ul class="content-box-tabs">
						<li><a class="default-tab">Danh sách</a></li> <!-- href must be unique and match the id of target div -->

					</ul>
					
					<div class="clear"></div>
					
				</div> <!-- End .content-box-header -->
				
				<div class="content-box-content">
			   
					<div class="tab-content default-tab" id="tab1"> <!-- This is the target div. id must match the href of this div's tab -->
					
                    <?php include '../widgets/thong_bao.php'; ?>
                    <form action="danh_sach.php" method="get">
                	<div><span style="font-size:14px"><b>Từ khóa:</b></span> <input class="text-input medium-input" type="text" name="tu_khoa" style="width:200px !important" />
                    	
                        <input class="button" type="submit" value="Tìm kiếm" />&nbsp;
                        <input class="button" type="button" value="Tất cả" onclick="window.location.href = 'danh_sach.php'" />
                </div>
                </form>
                    
					  <table>
							
						  <thead>
								<tr>
								   <th class="center"><input class="check-all" type="checkbox" /></th>
								   <th class="center">STT</th>
								   <th class="center">Họ &amp; tên người đăng ký</th>
								   <th class="center">Ngày tạo</th>
								   <th class="center">Trạng thái</th>
                                   <th class="center">Thao tác</th>
								</tr>
								
							</thead>
						 
							<tfoot>
								<tr>
									<td colspan="6">
										<div class="bulk-actions align-left">
                                        	<input class="button" name="bt_xoa_nhieu" type="button" value="Xóa nhiều" onclick="document.fList.submit()" />
                                        </div>
										
										<div class="pagination">
											<?php 
												#Tim tong so record
												$tong_so_mau_tin = $dt_xl_hoa_don->so_luong();
												
												#Tim tong so trang
												$tong_so_trang = $dt_pager->tim_tong_so_trang($tong_so_mau_tin, ADMIN_LIMIT);
												
												#In bo nut
												$dt_pager->in_bo_nut($tong_so_trang);
											?>
										</div> <!-- End .pagination -->
										<div class="clear"></div>
									</td>
								</tr>
							</tfoot>
                            
                            <form action="xoa_nhieu.php" method="post" name="fList">
						 
							<tbody>
                             
                            <?php
								
								#Vi tri bat dau (de query vao mysql)
								$vi_tri = $dt_pager->tim_vi_tri_bat_dau(ADMIN_LIMIT);
								
								#Goi ham danh sach de tra ra danh sach can lay
								$ds_hoa_don = $dt_xl_hoa_don->danh_sach($vi_tri, ADMIN_LIMIT);
								
								$i = $vi_tri;
								
								foreach($ds_hoa_don as $hoa_don) {
									
									
							?>
								<tr>
									<td class="center"><input type="checkbox" name="item[]" value="<?php echo $bai_viet['ma'] ?>" /></td>
									<td class="center"><?php echo ++$i ?></td>
									<td class="center"><?php echo $hoa_don['ho_ten_nguoi_nhan'] ?></td>
									<td class="center"><?php echo $hoa_don['ngay_tao'] ?></td>
									<td class="center"><img width="20px" src="../images/trang_thai_<?php echo $hoa_don['trang_thai'] ?>.png" /></td>
									<td class="center">
										<!-- Icons -->
										 <a href="cap_nhat.php?ma=<?php echo $hoa_don['ma'] ?>" title="Edit"><img src="../skins/sa/resources/images/icons/pencil.png" alt="Edit" /></a>
										 <a href="xoa.php?ma=<?php echo $hoa_don['ma'] ?>" title="Delete" onclick="return confirm('Bạn có chắc chắn muốn xóa không !!!')"><img src="../skins/sa/resources/images/icons/cross.png" alt="Delete" /></a>
									</td>
								</tr>
							<?php
                                }
                            ?>
								
							</tbody>
                            </form>
							
						</table>
						
					</div> <!-- End #tab1 -->
					
					
					
			  </div> <!-- End .content-box-content -->
				
			</div> <!-- End .content-box -->
			
			
			<div class="clear"></div>
			
			
			<?php include '../widgets/footer.php'; ?><!-- End #footer -->
			
		</div> <!-- End #main-content -->
		
	</div></body>
  
</html>
